/**
 * 
 */
package org.insia.smartposse.metier.webservice;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.insia.smartposse.metier.Project;
import org.insia.smartposse.metier.User;

/**
 * @author raguerri
 * @since 19 avr. 07
 * @version 0.0.1
 * 
 */
public class LightUser 
implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	protected long id;
	protected String login;
	protected String password;
	protected String firstName;
	protected String lastName;
	protected int gender;
	protected String email;
	protected char type;
	
	protected List<LightProject> projectSet = new ArrayList<LightProject>();

	public LightUser() {

	}
	public LightUser(User user) {
		id = user.getId();
		gender = user.getGender();
		
		login = user.getLogin();
		password = user.getPassword();
		firstName = user.getFirstName();
		lastName = user.getLastName();
		email = user.getEmail();
		
		if (user.getProjectSet().size() != 0) {
			for (Project proj : user.getProjectSet()) {
				projectSet.add(proj.setLight());
			}
		}
	}

	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @return the firstName
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * @return the gender
	 */
	public int getGender() {
		return gender;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @return the lastName
	 */
	public String getLastName() {
		return lastName;
	}

	/**
	 * @return the login
	 */
	public String getLogin() {
		return login;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @return the projectSet
	 */
	public List<LightProject> getProjectSet() {
		return projectSet;
	}

	/**
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @param firstName the firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * @param gender the gender to set
	 */
	public void setGender(int gender) {
		this.gender = gender;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @param lastName the lastName to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/**
	 * @param login the login to set
	 */
	public void setLogin(String login) {
		this.login = login;
	}

	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @param projectSet the projectSet to set
	 */
	public void setProjectSet(List<LightProject> projectSet) {
		this.projectSet = projectSet;
	}
	/**
	 * @return the type
	 */
	public char getType() {
		return type;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}
	/**
	 * @param type the type to set
	 */
	public void setType(char type) {
		this.type = type;
	}
}
